from sqlalchemy import (
    Boolean,
    Column,
    Integer,
    String,
    Text,
    DateTime,
    ForeignKey,
    JSON,
    BigInteger,
)
from app.database import Base
from sqlalchemy.orm import relationship, Mapped

class Announcement(Base):
    __tablename__ = "announcement"

    id = Column(BigInteger, primary_key=True, autoincrement=True)
    content = Column(Text)
    name = Column(String(255))
    poster = Column(String(255))
    published_time = Column(DateTime)
    type = Column(Integer)
    publisher = Column(BigInteger, ForeignKey("admin.id"))

    publisher_relation: Mapped["Admin"] = relationship()